package com.ruoyi.web.controller.system;

import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.service.ISmsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Anonymous
@RestController
public class SmsController {

    @Autowired
    private ISmsService service;


    @GetMapping("/sendCode")
    public AjaxResult sendCode(  String phone) {
        if (StringUtils.isBlank(phone)){
            return AjaxResult.error("手机号不能为空");
        }
        service.sendCode(phone);
        return AjaxResult.success();
    }
}
